#pragma once
#ifndef CandidatesDataProvider_header_included
#define CandidatesDataProvider_header_included

class CandidatesDataProvider
{
protected:
	struct CandidateNode
	{
		CandidateNode()
		{
			mParent = 0;
		}
		wxString GetDescription()
		{
			if (mDesc.empty())
				return wxString();
			wxString desc = wxString(_("Help: ")) + mKeystring + wxT("#") + mDesc;
			desc.Replace(wxT("##"), wxT("\n\t\t"));
			desc.Replace(wxT("#"), wxT("\n\t"));
			return desc;
		}
		wxString mKeystring; // Candidate string
		wxString mDesc;
		CandidateNode* mParent;
		std::vector<CandidateNode*> mChildren;
	};

public:
	CandidatesDataProvider(const wxString& dataFilepath);
	~CandidatesDataProvider();

	void Update(const wxString& editingScript);
	
	std::vector<CandidateNode*> mCurrentCandidates;

protected:
	std::vector<CandidateNode> mCandidates;
	CandidateNode* mCurrentParentCandidate;
	CandidateNode mRoot;


};

#endif //CandidatesDataProvider_header_included